<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量</title>
</head>
<body>
<p id="aaa">111</p>
<button type="button" onclick="mya()">点我</button>
<script>
    var a= 16;                                  // Number 通过数字字面量赋值
    var b = x * 10;                              // Number 通过表达式字面量赋值
    var c= "Johnson";                         // String 通过字符串字面量赋值
    var d = ["Saab", "Volvo", "BMW"];              // Array  通过数组字面量赋值
    var e = {firstName:"John", lastName:"Doe"};  // Object 通过对象字面量赋值
    var f=a+c;
    function mya() {
        x=document.getElementById("aaa");
        x.innerHTML=f;
    }
</script>
</body>
</html>